package com.frejoys.service;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.frejoys.common.dto.app.OrderAddressUpDto;
import com.frejoys.dao.entity.OrderAddress;

public interface OrderAddressService extends IService<OrderAddress> {

    default OrderAddress getOnly(QueryWrapper<OrderAddress> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    default OrderAddress getOnly(LambdaQueryWrapper<OrderAddress> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    // 保存信息
    boolean addInfo(OrderAddress orderAddress);

    /**
     * 获取信息
     * @param id
     * @return
     */
    OrderAddress getInfo(Integer id);


    boolean upInfo(OrderAddressUpDto dto);

}
